<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:common="http://java.sun.com/jsf/composite/common">
<h:body>
	<ui:composition template="/pages/templates/MainTemplate.xhtml">
		<ui:define name="content">
			<h:form id="addFormulaForm">
				<p:growl id="messages" globalOnly="true" showDetail="true"
					showSummary="true" closable="true" autoUpdate="true" />

				<legend>Formulas</legend>
				<common:CRUDMenuBar id="ordnProdMenuBar"
					crudManagedBean="#{formulasMB}">
				</common:CRUDMenuBar>
				<h:panelGroup layout="block" id="ordensDeProdDataTable">
					<p:outputPanel>
						<ui:include src="produccion/formulasList.xhtml"></ui:include>
					</p:outputPanel>
				</h:panelGroup>
				<h:panelGroup layout="block" id="abmPanel">
					<h:panelGroup layout="block" id="prodDetails"
						rendered="#{formulasMB.showAbm}">
						<legend>
							Datos de
							<h:outputText value=" #{formulasMB.selectedFormula.description}"></h:outputText>
						</legend>
						<h:panelGroup layout="block">
							<common:formulaPanel saveFormulaListner="#{formulasMB.save}"
								saveAsNewFormulaListner="#{formulasMB.saveAsNewFormula}"></common:formulaPanel>
						</h:panelGroup>
					</h:panelGroup>
				</h:panelGroup>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>